﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using iBuproModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using IBupro.Models.Classes;

namespace IBupro.Models
{
    public class SubjectModel : CustomModel
    {

        public SubjectModel()
        {
            this.Visible = true;
            this.Name = "";
        }

        public SubjectModel(string name, bool visible)
        {
            this.Visible = visible;
            this.Name = name;
        }

        public SubjectModel(string name, bool visible, int deptId,string shortcut)
        {
            this.Visible = visible;
            this.Name = name;
            this.DepartmentId = deptId;
            this.Shortcut = shortcut;
        }

        public int Id { get; set; }

        [Required]
        [StringLength(30,ErrorMessage="Please specify subject name",MinimumLength=1)]
        public string Name { get; set; }

        [StringLength(30, ErrorMessage = "Please specify shortcut", MinimumLength = 1)]
        public string Shortcut { get; set; }

        public bool Visible { get; set; }

        [Required]
        public int DepartmentId { get; set; }
    }
}